from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome() # 实例化驱动
driver.get("https://www.baidu.com/") #打开百度页面
driver.maximize_window() # 最大化

# 手写xpath  @id='value'
search = driver.find_element(By.XPATH,"//*[@id='kw']")
search.clear() # 先清除
search.send_keys("selenium1") # 再输入

# 联合定位
search2 = driver.find_element(By.XPATH,"//*[@id='kw' and @class='s_ipt']")
search2.clear() # 先清除
search2.send_keys("selenium2")# 再输入








